<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="../style/ucs.css">
    <link rel="stylesheet" href="../content/font/iconfont.css">
    <link rel="stylesheet" href="../style/theme.css">
</head>
<body>
    <div id="giraffe"></div>
    <script type="text/javascript" src="../../dist/libs/u-eventhub.js"></script>
    <script type="text/javascript" src="../../dist/libs/engine.js"></script>
    <script type="text/javascript" src="../../dist/ucsmy-ui.js"></script>

    <script type="text/javascript">
        //个人实名信息
        var realNameInfoDM = new UDM({
            value:{
                IsNew:0, //是否有新消息
                AccType:0,
                Mobile:"",
                IsBindMobile:"",//是否绑定手机
                BindMobileUrl:"../UserInfo/index.html",//绑定手机链接
                IsBindIDCard:"",//是否验证身份
                BindIDCardUrl:"../UserInfo/index.html",//验证身份链接
                IsBindBankCard:"",//是否绑卡
                BindBankCardUrl:"../MyBankCard/index.html",//绑卡链接
                Current:"MyBankCard",  //当前选中菜单
                InvestAccountUrl:"../MyAccount11/index.html",//投资账户总览链接
                InvestListUrl:"../MyInvest/index.html",//投资记录链接
                MyBankCardUrl:"../MyBankCard/index.html",//我的银行卡链接
                InvestInfoUrl:"../UserInfo/index.html",//投资个人信息
                InvestMessageUrl:"../UserMessageCenter/index.html",//投资消息中心
                FinanceAccountUrl:"../FinanceAccount/index.html",//融资账户总览链接
                FinanceListUrl:"../FinanceList/index.html",//融资记录链接
                FinanceAccountInfoUrl:"../AccountInfo/index.html",//融资账号信息
                FinanceMessageUrl:"../CompanyMessageCenter/index.html"//融资消息中心
            }
        })
        //银行卡记录模型
        var cardListDM = new UDM({
            value:[
                {
                    "UserBankAccountId": "6dd0a8d88aee4a48af3af026e210430f",
                    "AccountNo":"6200 **** 5510",
                    "AccountName":"萧英相",
                    "BankType":0,
                    "BankName":"中信银行",
                    "BankLogo":"bank-ecitic",
                    "IsCanOverBindCard":"0"
                },
                {
                    "UserBankAccountId":"df1d3f5c3ef34a60ac7f657c8eea3e21",
                    "AccountNo":"6200 **** 4410",
                    "AccountName":"萧英相",
                    "BankType":0,
                    "BankName":"中国建设银行",
                    "BankLogo":"bank-ccb",
                    "IsCanOverBindCard":"0"
                }],
            delclick: function (id) {
                console.log('删除'+id);

                PageDM.dclayer.showDialog();
					
            }

        })


        /* 删除银行卡时输入密码的数据模型*/
        var dcPasswordDM = new UDM({
            maxLength:8,
            placeholder:"支付密码为6为纯数字",
            validator:[
                {type:"require",msg:"不能为空"}
            ]
        })

        //删除银行卡弹框模型
        var dclayerDM = new Dialog({
        	confirmBack:function () {
                dclayerDM.hideDialog();
                UDialog.alert({title:'dddd',content:'ddddd',closeBack:function () {
                    PageDM.cardList.setValue([{
                        "UserBankAccountId":"df1d3f5c3ef34a60ac7f657c8eea3e21",
                        "AccountNo":"6200 **** 4410",
                        "AccountName":"萧英相",
                        "BankType":0,
                        "BankName":"中国建设银行",
                        "BankLogo":"bank-ccb",
                        "IsCanOverBindCard":"0"
                    },
                        {
                            "UserBankAccountId":"df1d3f5c3ef34a60ac7f657c8eea3e21",
                            "AccountNo":"6200 **** 4410",
                            "AccountName":"萧英相",
                            "BankType":0,
                            "BankName":"中国建设银行",
                            "BankLogo":"bank-ccb",
                            "IsCanOverBindCard":"0"
                        }])
                }})

            },
            cancelBack: function () {
                dclayerDM.hideDialog();

            },
            closeBack: function () {
                dclayerDM.hideDialog();

            }
        })

        
        //模拟后台返回数据
        var listValue = [
            {
                "UserBankAccountId": "6dd0a8d88aee4a48af3af026e210430f",
                "AccountNo":"6200 **** 5510",
                "AccountName":"萧英相",
                "BankType":0,
                "BankName":"中信银行",
                "BankLogo":"bank-ecitic",
                "IsCanOverBindCard":"0"
            },
            {
                "UserBankAccountId":"df1d3f5c3ef34a60ac7f657c8eea3e21",
                "AccountNo":"6200 **** 4410",
                "AccountName":"萧英相",
                "BankType":0,
                "BankName":"中国建设银行",
                "BankLogo":"bank-ccb",
                "IsCanOverBindCard":"0"
            },
            {
                "UserBankAccountId":"df1d3f5c3ef34a60ac7f657c8eea3e21",
                "AccountNo":"6200 **** 4410",
                "AccountName":"萧英相",
                "BankType":0,
                "BankName":"中国建设银行",
                "BankLogo":"bank-ccb",
                "IsCanOverBindCard":"0"
            }
        ];
        var URLDM = new UDM({
            addBankCard:'../AddBankCard/index.html'
        })
        var ajaxFn = function () {

            cardListDM.setValue(listValue);
            /*个人实名信息*/
            var realName = {
                AccType:0,
                Mobile:"155****2132",
                IsBindMobile:true,//是否绑定手机
                BindMobileUrl:"../UserInfo/index.html",//绑定手机链接
                IsBindIDCard:false,//是否验证身份
                BindIDCardUrl:"../UserInfo/index.html",//验证身份链接
                IsBindBankCard:false,//是否绑卡
                BindBankCardUrl:"../MyBankCard/index.html",//绑卡链接
                Current:"MyBankCard",  //当前选中菜单
                InvestAccountUrl:"../MyAccount/index.html",//投资账户总览链接
                InvestListUrl:"../MyInvest/index.html",//投资记录链接
                MyBankCardUrl:"../MyBankCard/index.html",//我的银行卡链接
                InvestInfoUrl:"../UserInfo/index.html",//投资个人信息
                InvestMessageUrl:"../UserMessageCenter/index.html",//投资消息中心
                FinanceAccountUrl:"../FinanceAccount/index.html",//融资账户总览链接
                FinanceListUrl:"../FinanceList/index.html",//融资记录链接
                FinanceAccountInfoUrl:"../AccountInfo/index.html",//融资账号信息
                FinanceMessageUrl:"../CompanyMessageCenter/index.html"//融资消息中心
            };

            realNameInfoDM.setValue(realName);
        }
        var PageDM = {
            realNameInfo: realNameInfoDM,
            cardList: cardListDM,
            dclayer: dclayerDM,
            dcPassword: dcPasswordDM,
            url:URLDM
        }

        UEventHub.on('pageLoad', function(v){
            ajaxFn();
            console.log(v);
            UEventHub.emit("test","你好，","世界！");
        });
    </script>
</body>
</html>